#ifndef VIDEOIMAGEPROVIDER_H
#define VIDEOIMAGEPROVIDER_H

#include <QQuickImageProvider>
#include <QImage>
#include <QMutex>
#include "videocontroller.h"

// 视频图像提供者：供QML获取视频帧
class VideoImageProvider : public QQuickImageProvider
{
public:
    VideoImageProvider(VideoController *controller);

    // 重写请求图像函数
    QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override;

private:
    VideoController *m_controller;  // 视频控制器指针（用于获取当前帧）
};

#endif // VIDEOIMAGEPROVIDER_H
